const {
  globalData
} = getApp();
Component({
  properties: {
    showIndex: null,
    finish: null
  },
  data: {
    content: {}
  },
  attached() {
    this.properties.showIndex && clearTimeout(globalData.timer)
    this.changePage()
  },
  methods: {
      
    changePage(index,hasNoCourse) {

      let title = ['今天没有排课，好好休息吧', '您已退出该班级，请耐心等待下一个班级的开始', '您已结束该课程的学习，请好好准备以后的学习!'][index];
      let showIndex = this.properties.showIndex
      let contentArr = [{
          title: title,
          picUrl: '/images/attendance/xiuxi@2x.png'
        },
        {
          picUrl: '/images/attendance/kaoqingxixin@2x.png',
          text: '暂无考勤信息'
        },
        {
          picUrl: '/images/attendance/xiuxi@2x.png',
          // text: '暂无考勤信息'
        },
        {
          picUrl: '/images/attendance/wukaoqing@2x.png',
          text: '暂无相关考勤统计信息'
        }
      ]

      if (hasNoCourse){
        showIndex = hasNoCourse
      }
      this.setData({
        content: contentArr[showIndex]
      })
    }
  }
})